package com.alan.test.base;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.alan.base.App;
import com.alan.base.ui.BaseActivity;
import com.alan.base.utils.IntentUtils;
import com.alan.base.utils.Logger;
import com.alan.base.utils.ThreadUtils;

public class MainActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn_translate).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                IntentUtils.startSimpleActivity(MainActivity.this, TranslateActivity.class);
            }
        });

        findViewById(R.id.btn_status).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                IntentUtils.startSimpleActivity(MainActivity.this, StatusBarActivity.class);
            }
        });

        findViewById(R.id.btn_log).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Logger.f("点击了！！！");
                Logger.d("点击了！！！");
            }
        });

        findViewById(R.id.btn_bottom).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                IntentUtils.startSimpleActivity(MainActivity.this, TestBottomActivity.class);
            }
        });

        findViewById(R.id.btn_test_tread).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ThreadUtils.run(new ThreadUtils.OnThreadRunnable<String>() {
                    @Override
                    public String onThread() {
                        Logger.d("OnThreadRunnable onThread");
                        return "hello";
                    }

                    @Override
                    public void onMainThread(String s) {
                        Logger.d("OnThreadRunnable onMainThread:" + s);
                    }
                });
            }
        });

    }
}